import React, { Component } from 'react';
import BottomBar from '../components/BottomBar';
import TopBar from '../components/TopBar';

class Layout extends Component {
    componentDidMount(){
        const { title } = this.props
        document.title = title
    }
    // 组件复合
    render() {
        const { children, showTopBar, showBottomBar } = this.props
        return (
            <div>
                { showTopBar && <TopBar /> }
                {/* { children } */}
                { children.content }
                { showBottomBar && <BottomBar /> }
            </div>
        );
    }
}

export default Layout;